package com.lkd.feign.fallback;

import com.lkd.feign.OrderService;
import com.lkd.vo.PayVO;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class OrderServiceFallbackFactory implements FallbackFactory<OrderService> {


    /**
     * 新建快速熔断
     *
     * @param throwable
     * @return
     */
    @Override
    public OrderService create(Throwable throwable) {
        log.error("微信支付调用失败", throwable);

        //快速失败
        return payVO -> null;
    }
}
